package com.juneng.config;

/**
 * @author JohnSoybean
 * @create 2020/4/15 14:55
 * @description Redis过期时间枚举类
 */
public enum RedisKey {

    /**
     * 身份权限验证token
     *
     * @prefix TOKEN:
     * @expire 7天
     */
    TOKEN("TOKEN:", 60 * 1000 * 24 * 7),

    /**
     * 验证码 登录
     *
     * @prefix SMS_CODE_1:
     * @expire 5分钟
     */
    SMS_CODE("SMS_CODE_%d:", 300),

    /**
     * 支付宝实名认证缓存
     * @prefix ALI_CERTIFY_ID:
     * @expire 10天
     */
    ALI_CERTIFY_ID("ALI_CERTIFY_ID:", 864000),

    /**
     * 考试排名信息
     * @prefix EXAM_RANK:
     * @expire 永不
     */
    EXAM_RANK("EXAM_RANK:", -1)
    ;


    private final String prefix;
    private final long expire;

    RedisKey(String prefix, long expire) {
        this.prefix = prefix;
        this.expire = expire;
    }

    public String getPrefix() {
        return prefix;
    }

    public long getExpire() {
        return expire;
    }
}
